package com.study.design.factory;

/**
 * @Author 网易云课堂微专业-java高级开发工程师【allen老师】
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {

        Product product1 = new ConcreteProduct1();
        Product product2 = new ConcreteProduct2();
        Product product3 = new ConcreteProduct();


//        int type = 1;
//        Product product;
//        if (type == 1) {
//            product = new ConcreteProduct1();
//        } else if (type == 2) {
//            product = new ConcreteProduct2();
//        } else {
//            product = new ConcreteProduct();
//        }
        // do something with the product

        SimpleFactory simpleFactory = new SimpleFactory();
        Product product = simpleFactory.createProduct(1);
        // do something with the product
    }

}
